package model

import (
	"gorm.io/gorm"
	__ "videosS_rpc/basic/proto"
)

type Collect struct {
	gorm.Model
	VideoId      int `gorm:"type:int;commit:视频Id;"`
	UserId       int `gorm:"type:int;commit:用户Id;"`
	CollectCount int `gorm:"type:int;commit:收藏数量;"`
}

//type Like struct {
//	VideoId int `gorm:"type:int;commit:视频Id;"`
//	UserId  int `gorm:"type:int;commit:用户Id;"`
//	Count   int `gorm:"type:int;commit:数量;"`
//}

//func (l *Like) LikeAdd(DB *gorm.DB) error {
//	var err error
//	err = DB.Create(&l).Error
//	return err
//}

func (c *Collect) CollectAdd(DB *gorm.DB) error {
	var err error
	err = DB.Create(&c).Error
	return err
}

func (c *Collect) CollectList(DB *gorm.DB) (list []*__.CollectList, err error) {
	err = DB.Model(&c).Find(&list).Error
	return list, err
}
